package tests;

import common.Utils;
import org.openqa.selenium.By;

public class ListPage extends Utils {
    public static String url = "http://127.0.0.1:58080/index.html";
    public ListPage() {
        super(url);
    }

    /**
     * listnavigation
     * 列表导航栏
     */
    public void listnavigation() {
        driver.findElement(By.cssSelector("#navbar-menu > div"));
    }

    /**
     * listInput
     * 输入框
     */
    public void listInput() {
        driver.findElement(By.cssSelector("body > div.page > header.navbar.navbar-expand-md.navbar-light.d-print-none > div > div > div.nav-item.d-none.d-md-flex.me-3 > div > form > div > input"));
    }

    /**
     * personPage
     * 个人主页
     */
    public void personPage() {
        driver.findElement(By.cssSelector("#index_user_settings"));
    }

    /**
     * advicePage
     * 消息通知
     */
    public void advicePage() {
        driver.findElement(By.cssSelector("body > div.page > header.navbar.navbar-expand-md.navbar-light.d-print-none > div > div > div:nth-child(2) > div > a > svg"));
    }

    /**
     * lightModel
     * 白天模式/黑夜模式
     */
    public void lightModel() {
        driver.findElement(By.cssSelector("body > div.page > header.navbar.navbar-expand-md.navbar-light.d-print-none > div > div > div:nth-child(2) > a.nav-link.px-0.hide-theme-dark > svg > path:nth-child(2)"));
    }

    /**
     * listPage
     * 论坛列表页
     */
    public void listPage() {
        driver.findElement(By.cssSelector("body > div.page > header.navbar.navbar-expand-md.navbar-light.d-print-none > div > h1 > a > img"));
    }

    /**
     * publishPost
     * 发布帖子
     */
    public void publishPost() {
        driver.findElement(By.cssSelector("#bit-forum-content > div.page-header.d-print-none > div > div > div.col-auto.ms-auto.d-print-none > div > a.btn.btn-primary.d-none.d-sm-inline-block.article_post"));
    }
}
